/**
 *  Copyright (C) 2023 - Fake Inc.
 *
 *  All Rights Reserved.

*/


#ifndef INNO_LIDAR_LOG_H_
#define INNO_LIDAR_LOG_H_
#include <stdint.h>
#include <stdio.h>

#define INNO_LOG_LEVEL_TRACE 0
#define INNO_LOG_LEVEL_DEBUG 1
#define INNO_LOG_LEVEL_INFO 2
#define INNO_LOG_LEVEL_WARN 3
#define INNO_LOG_LEVEL_ERROR 4
#define INNO_LOG_LEVEL_CRITICAL 5
#define INNO_LOG_LEVEL_OFF 6

#ifndef inno_log_debug
#define inno_log_debug(cmd_fmt, ...) \
    inno_log(INNO_LOG_LEVEL_DEBUG, __FILE__, __FUNCTION__, __LINE__, cmd_fmt, __VA_ARGS__)
#endif

#ifndef inno_log_info
#define inno_log_info(cmd_fmt, ...) \
    inno_log(INNO_LOG_LEVEL_INFO, __FILE__, __FUNCTION__, __LINE__, cmd_fmt, __VA_ARGS__)
#endif

#ifndef inno_log_error
#define inno_log_error(cmd_fmt, ...) \
    inno_log(INNO_LOG_LEVEL_ERROR, __FILE__, __FUNCTION__, __LINE__, cmd_fmt, __VA_ARGS__)
#endif

// void inno_log(int32_t log_level,
//         const char* file_name, const char* func_name, uint32_t line_no, const char *fmt_str, ...);

// todo temporary define inno_log
#define inno_log(log_level,  file_name, func_name, line_no, ...) \
        printf(__VA_ARGS__); \
        printf("\n");

#endif
